ALLOWED_HOSTS = ['localhost', '127.0.0.1','www.bolean.com.cn','192.168.166.117']

# Database
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases
import os


DATABASES = {
    'default': {
        "ENGINE": "django.db.backends.postgresql_psycopg2",
        "NAME": "blog_demo",
        "USER": "bolean",
        "PASSWORD":"Bl666666",
        "HOST": "localhost",
        "PORT": "5432",
    }
}

LOGGING = {
    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },
    'filters': {
        'require_debug_true': {
            '()': 'django.utils.log.RequireDebugTrue',
        },
    },
    'handlers': {
        'console': {
            'level': 'INFO',
            'filters': ['require_debug_true'],
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        },
        'file': {
            'level': 'WARNING',
            'class': 'logging.FileHandler',
            'filename': '/Users/yangjie/logs/blog_demo.log',
            'formatter': 'verbose'
        },
    },
    'loggers': {
        # 'django': {
        #     'handlers': ['file'],
        #     'propagate': True,
        #     'formatter': 'simple'
        # },
        # 'django.request': {
        #     'handlers': ['file'],
        #     'level': 'WARNING',
        #     'propagate': True,
        #     'formatter': 'verbose'
        # },
        '': {
            'handlers': ['file'],
            'propagate': False,
            'formatter': 'simple'
        },
    }
}
